function saveOptions(optionsForm){
    
    $(":input", optionsForm).each(function(){
        
        var type = this.type;
        var id = this.id;
        
        if (type == "text" || type == "password")
            localStorage[id] = this.value;
        
    });

    localStorage["saved"] = true;

}

function restoreOptions(optionsForm){
    
    var saved = localStorage["saved"] == "true";
    
    if (!saved)
        return;
    
    $(":input", optionsForm).each(function(){
        
        var id = this.id;
        this.value = localStorage[id];
        
    })

}